Skip to content

Demo for native extra fields usage#246

Open
Jeremie-Kiwik wants to merge 11 commits into
PrestaShop:masterfrom
Jeremie-Kiwik:pr-demoextrafield
Open

Demo for native extra fields usage#246
Jeremie-Kiwik wants to merge 11 commits into
PrestaShop:masterfrom
Jeremie-Kiwik:pr-demoextrafield

Conversation

@Jeremie-Kiwik

Copy link
Copy Markdown
Questions Answers
Description? Add a demo module for extra fields usage on PrestaShop
Type? new feature
BC breaks? no
Deprecations? no
Fixed ticket? Example usage of PrestaShop/PrestaShop#41092
Sponsor company KIWIK
How to test? See demoextrafield/README.md

Comment thread demoextrafield/demoextrafield.php Outdated
$this->version = '1.0.0';
$this->author = 'PrestaShop';
$this->need_instance = 0;
$this->ps_versions_compliancy = ['min' => '9.1.0', 'max' => '9.9.99'];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$this->ps_versions_compliancy = ['min' => '9.1.0', 'max' => '9.9.99'];
$this->ps_versions_compliancy = ['min' => '9.2.0', 'max' => '9.9.99'];

Jeremie-Kiwik and others added 8 commits May 28, 2026 11:54
- hookDisplayCustomerAccountTop passes the Customer ObjectModel directly
  to Smarty — no presenter, no array conversion; FO filtering is native
- _extra_properties.tpl: first hop uses object syntax (works for both
  LazyArrays and raw ObjectModels via __get; ObjectModel is not ArrayAccess),
  empty-state handled with foreachelse (bags are objects, empty() cannot work)
- category marketing_note registered with displayFront: false to validate
  FO filtering through the presenter LazyArray path (customer internal_note
  covers the native ObjectModel path)
- Register cms/promo_banner (LANG) and cms/revision_code (COMMON) without
  associatedForms: the module integrates them into the migrated CMS page
  form manually via actionCmsPageFormBuilderModifier (TranslatableType +
  TextType), actionCmsPageFormDataProviderData (prefill from the native
  multilang bag) and actionAfterCreate/UpdateCmsPageFormHandler
- Persistence is the native ObjectModel multilang round-trip: new CMS($id)
  without langId loads [id_lang => value] arrays, all languages are
  assigned and saved in one $cms->update()
- FO display via displayCMSDisputeInformation: CMS instantiated with the
  context langId (lang fields as scalars, FO-filtered bag) + named access
  through the ObjectPresenter-presented $cms global
- Unregister all hooks on uninstall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wip work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants